﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity.Initial.IValue;
using NUnit.Framework;

namespace Entity.Initial
{

    public class RUN
    {
        List<Ini> Ls = new List<Ini>()
                         {
                             new AdmColInit() ,
                             new AdmDepartInit() ,
                             new AdmInit(),
                             new PartnerInit(),
                             new CompInit(),
                         };
        [Test]
        public void R()
        {
            RunLs(Ls);
        }

        [Test]
        public void R_Dubug()
        {
            RunLs_Dubug(Ls);
        }

        [Test]
        public void Del_Dubug()
        {
            List<Ini> DelLs = new List<Ini>()
                         {
                             new Comp_InfoInit(),
                             new CompInit(),
                             new AdmInit(),

                             new AdmColInit() ,
                             new AdmDepartInit() ,
                             new PartnerInit(),
                         };
            foreach (Ini inital in DelLs)
            {
                inital.Clear();
            }
        }
        private void RunLs_Dubug(List<Ini> ls)
        {
            foreach (Ini inital in ls)
            {
                inital.Run1();
                inital.Run2();
                inital.Run3();
                inital.Run4();
                inital.Run5();
                inital.Run6();
            }
        }

        private static void RunLs(List<Ini> Ls)
        {
            foreach (Ini inital in Ls)
            {
                try
                {
                    inital.Run1();
                }
                catch (Exception)
                {
                }
                try
                {
                    inital.Run2();
                }
                catch (Exception)
                {
                }
                try
                {
                    inital.Run3();
                }
                catch (Exception)
                {
                }
                try
                {
                    inital.Run4();
                }
                catch (Exception)
                {
                }
                try
                {
                    inital.Run5();
                }
                catch (Exception)
                {
                }
                try
                {
                    inital.Run6();
                }
                catch (Exception)
                {
                }
            }
        }
    }

    public abstract class Ini
    {
        public abstract void Run1();
        public abstract void Run2();
        public abstract void Run3();
        public abstract void Run4();
        public abstract void Run5();
        public abstract void Run6();
        public abstract void Clear();
    }
}
